package gestion.horarios.view.jsf.beans;

import java.io.Serializable;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.context.FacesContext;

@ManagedBean (name="LOGOUT") 
@RequestScoped
public class LogoutManagedBean implements Serializable {
	
	private static final long serialVersionUID = 1L;
	private FacesContext context;
	
	public String logout() {
		System.out.println("* * * Entra a logout " );
		
		context = FacesContext.getCurrentInstance();
		context.getExternalContext().getSessionMap().remove("LOGIN"); 
		
		System.out.println("Sale de  logout");
		return "welcome";
		
	}
}
